﻿using System.Windows;

namespace PengSW.SqlServerTools
{
    /// <summary>
    /// Login.xaml 的交互逻辑
    /// </summary>
    public partial class Login : Window
    {
        public Login(LoginContent aLoginContent)
        {
            InitializeComponent();
            _LoginContent = aLoginContent;
            this.DataContext = _LoginContent;
        }

        private LoginContent _LoginContent;

        private void OnOk_Executed(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void OnOk_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = _LoginContent != null && _LoginContent.IsValid;
        }
    }
}
